/*
 * @Description: {首页} 
 * @Author: zhuoyan 
 * @Date: 2019-09-26 10:51:22 
 */

$(function () {

    defaultAjaxAsync(chartsSrc, JSON.stringify({
        areaCode: areaCode,
        typeCode: '城市畅通情况'
    }), function (r_data) {
        console.log('r_data', r_data)
        if (!r_data.success) return;
        var data = r_data.data;
        data.forEach(function (item) {
            switch (item.sjdctName) {
                case '邮政快递畅通度':
                    fillData('1001', item.sjdctValue);
                    break;
                case '生活服务畅通度':
                    fillData('1002', item.sjdctValue);
                    break;
            }
        });
        //左侧图表-1
        // chart_l1()
    }, true);

    chart_l1();

    createTable();

    function createTable(pdata) {
        var list = '';
        for (let index = 0; index < 15; index++) {
            list += `
            <li>
                <div class="table-tr flex">
                    <div class="table-index"><span class="index-bg">${index+1}</span></div>
                    <div class="flex-item">街道${index+1}</div>
                    <div class="flex-item table-blue">${random(1000,2000)}/${random(100,300)}</div>
                    <div class="flex-item table-blue">${random(10,90)}%</div>
                    <div class="flex-item table-green">${random(10,60)}%</div>
                    <div class="flex-item table-orange">${random(10,20)}%</div>
                </div>
            </li>
            `;
        }
        $('#common-scroll-table-ul').empty().append(list);
        $(".common-scroll-table").slide({
            mainCell: ".bd ul",
            autoPage: true,
            effect: "top",
            autoPlay: true,
            vis: 4
        });
    }

});